extends IInputAction


class_name InputKeyboard
"""
通过键盘触发
"""


## 触发的按键
@export var key_action: String = "ui_accept"
## 按下时是否重复触发
@export var is_persistent_pressed: bool = false


func __is_input_pressed(e: InputEvent) -> bool:
    if is_persistent_pressed:
        return e.is_action(key_action) and e.is_pressed()
    return e.is_action_pressed(key_action)

func __is_input_released(e: InputEvent) -> bool:
    return e.is_action_released(key_action)
